<?php


function yieldCommand($fileName) {

    $line = [];
    $handle = fopen($fileName, "r");

    while (!feof($handle)) {
        $i++;
        yield ltrim(fgets($handle));
    }
    echo 'i===='.$i,PHP_EOL;
    fclose($handle);

}

$start = time();

foreach (yieldCommand("data.txt") as $key => $value) {
    if ($key >= 9968768) {
        echo $value,PHP_EOL;
    }
}
print_r($key);
echo PHP_EOL;


echo '========================',PHP_EOL;

$result = time()-$start;

echo '==============='.$result.'===============';










